<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>쇼핑몰 관리자 홈페이지</title>
<link rel="stylesheet" href="/resources/common/adminCommon.css">
<script>
	function go_new()
	{
		location.href="productInsertForm";
	}
</script>
</head>

<body bgcolor="white" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<center>

<br>
<jsp:include page="../main_header.jsp" flush="true"/>

<table width="800" border="0" cellspacing="0" cellpadding="0">
	<form name="form1" method="post" action="product.html">
	<tr height="40">
		<td align="left"  width="150" valign="bottom">&nbsp 제품수 : <font color="#FF0000"></font></td>
		<td align="right" width="550" valign="bottom">
			<select name="sel1">
				<option value="0" >상품상태</option>
				<option value="1" >판매중</option>
				<option value="2" >판매중지</option>
				<option value="3" >품절</option>
			</select> &nbsp 
			<select name="sel2">
				<option value="0" >아이콘선택</option>
				<option value="1" >New</option>
				<option value="2" >Hit</option>
				<option value="3" >Sale</option>
			</select> &nbsp 
			<select name="sel3">
				<option value="0" >분류선택</option>
				<option value="1" >바지</option>
				<option value="2" >코트</option>
				<option value="3" >브라우스</option>
			</select> &nbsp 
			<select name="sel4">
				<option value="1" selected>제품이름</option>
				<option value="2" >제품번호</option>
			</select>
			<input type="text" name="text1" size="10" value="">&nbsp
		</td>
		<td align="left" width="100" valign="bottom">
			<input type="button" value="검색" onclick="javascript:form1.submit();"> &nbsp;&nbsp
			<input type="button" value="입력" onclick="location.href='productInsertForm';">
		</td>
	</tr>
	<tr><td height="5"></td></tr>
	</form>
</table>

<table width="800" border="1" cellspacing="0" bordercolordark="white" bordercolorlight="black">
	<tr bgcolor="#CCCCCC" height="23"> 
		<td width="50" align="center">제품명</td>
		<td width="280" align="center">제품명</td>
		<td width="70"  align="center">판매가</td>
		<td width="50"  align="center">상태</td>
		<td width="120" align="center">이벤트</td>
		<td width="80"  align="center">수정/삭제</td>
	</tr>
	<c:forEach items="${ProductList}" var="Product" >
	<tr bgcolor="#F2F2F2" height="23">	
		<td width="50" style="text-align: center;">&nbsp ${Product.NO }</td>
		<td width="150">&nbsp ${Product.NAME }</td>
		<td width="70"  align="right">${Product.PRICE } &nbsp</td>	
		
		<!-- 제품의 상태를 출력을 위한 if - else if문 -->
		<c:choose>
			<c:when test="${Product.STATUS==1}"> <td width="50"  align="center">판매중</td>	 </c:when>
			<c:when test="${Product.STATUS==2}"> <td width="50"  align="center">판매중지</td>	 </c:when>
			<c:when test="${Product.STATUS==3}"> <td width="50"  align="center">품절</td>	 </c:when>
		</c:choose>
		
		<td width="120" align="center">
				<c:if test="${Product.ICON_NEW!=null}">New</c:if>
				<c:if test="${Product.ICON_HIT!=null}">Hit</c:if>
				<c:if test="${Product.ICON_SALE!=null}">Sale[${Product.DISCOUNT}]%</c:if>
		</td>
		<!-- <td width="120" align="center">&nbsp ${Product.icon_new} ${Product.icon_hit} ${Product.icon_hit} ${Product.discount}</td> -->
		
		
		<td width="80"  align="center">
			<a href="/admin/productEditForm?no=${Product.NO}">수정</a>/
			<a href="/admin/productDelete?no=${Product.NO}" onclick="javascript:return confirm('삭제할까요 ?');">삭제</a>
		</td>
	</tr>
	</c:forEach>
</table>

<br>
<table width="800" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td height="30" class="cmfont" align="center">
			<img src="resources/image/images/i_prev.gif" align="absmiddle" border="0"> 
			<font color="#FC0504"><b>1</b></font>&nbsp;
			<a href="product.html?page=2&sel1=&sel2=&sel3=&sel4=&text1="><font color="#7C7A77">[2]</font></a>&nbsp;
			<a href="product.html?page=3&sel1=&sel2=&sel3=&sel4=&text1="><font color="#7C7A77">[3]</font></a>&nbsp;
			<img src="resources/image/images/i_next.gif" align="absmiddle" border="0">
		</td>
	</tr>
</table>

</center>

</body>
</html>